package net.gilgame.bukkit;

import java.util.logging.Level;
import java.util.logging.Logger;
import net.gilgame.bukkit.lib.Groups;
import net.gilgame.bukkit.lib.Messages;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

/**
 *
 * @author Gilgame
 * @date 27 November 2011
 */
public class EntityAdmin extends JavaPlugin
{
    public static final Logger LOGGER = Logger.getLogger("Minecraft");

    private CommandHandler commandHandler = new CommandHandler();

    @Override
    public void onEnable()
    {
        String message = String.format(Messages.Enabled, this.getDescription().getVersion());
        LOGGER.log(Level.INFO, message);
        Groups.Populate();
    }

    @Override
    public void onDisable()
    {
        LOGGER.log(Level.INFO, Messages.Disabled);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
    {
        return commandHandler.run(sender, command, label, args);
    }
}
